interface ICollection {
  // 索引签名
  [index: number]: string
  length: number
}

function iteratorCollection(collection: ICollection) {
  console.log(collection[0])
  console.log(collection[1])
}

const names = ["abc", "cba", "nba"]
const tuple: [string, string] = ["why", "18"]

iteratorCollection(names)
iteratorCollection(tuple)


interface ICollection1 {
  [index: string]: number
  length: number
}
function iteratorCollection1(collection: ICollection1) {
  console.log(collection[0])
  console.log(collection[1])
}
iteratorCollection1({ name: 111, age: 18, length: 10 })


export { }